package com.ee.chat.cps.admin.controller.datareport;

import com.ee.chat.common.bean.Result;
import com.ee.chat.cps.admin.service.IPromoteUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author AppiJ
 * @Date 2020/4/1 16:07
 */
@RestController
@RequestMapping("dataReport/promoteUser")
public class PromoteUserController {
    private Logger log = LoggerFactory.getLogger(PromoteUserController.class);

    @Resource
    IPromoteUserService promoteUserService;

    /**
     * 获取推广用户列表
     * @Author AppiJ
     * @Date 2020/4/1 16:23
     * @param user  用户信息
     * @param time  日期时间
     * @return
     */
    @RequestMapping("list")
    public Result list(HttpServletRequest request, String user, Integer type, String time,
                       @RequestParam Integer page, @RequestParam Integer limit){
        try{
            return promoteUserService.list(request, user, type, time, page, limit);
        }catch (Exception e){
            log.error("【获取推广用户列表错误】", e);
        }
        return Result.returnFailure();
    }
}
